package com.hjtech.base.router.model.user;
/*
 * 项目名:    HjtechARouterFrame
 * 包名       com.hjtech.base.routermanager.model.usermode
 * 文件名:    UserIntent
 * 创建者:    YHF
 * 创建时间:  2017/10/26 0026 on 14:18
 * 描述:     TODO
 */

import android.app.Activity;
import android.os.Bundle;

import com.alibaba.android.arouter.launcher.ARouter;
import com.apkfuns.logutils.LogUtils;
import com.hjtech.base.base.BaseIntent;
import com.hjtech.base.router.provider.IUserProvider;

import java.io.Serializable;

public class UserIntent extends BaseIntent {

    public static void intentClass(Serializable data, String path) {
        if (HasModel(path)) {
            Bundle bundle = new Bundle();
            bundle.putSerializable("data", data);
            ARouter.getInstance().build(path).with(bundle).navigation();
        } else {
            LogUtils.e("该模块暂未开放");
        }
    }

    /**
     * staractivityForResult
     *
     * @param data        传递的数据
     * @param path        跳转的路径
     * @param activity    实例
     * @param requestCode coed
     */
    public static void intentClass(Serializable data, String path, Activity activity, int requestCode) {
        if (HasModel(IUserProvider.USER_SERVICE)) {
            Bundle bundle = new Bundle();
            bundle.putSerializable("data", data);
            ARouter.getInstance().build(path).with(bundle).navigation(activity, requestCode);
        } else {
            LogUtils.e("该模块暂未开放");
        }
    }


}
